package com.java_senior_5;

import java.util.*;

public class Test {
    public static void main(String[] args) {
        Student stu1=new Student("张三",20,90F);
        Student stu2=new Student("李四",22,90F);
        Student stu3=new Student("王五",20,95F);
        Student stu4=new Student("赵六",22,100F);
        Student stu5=new Student("田七",26,87F);
        List<Student> list=new ArrayList<>();
        list.add(stu1);
        list.add(stu2);
        list.add(stu3);
        list.add(stu4);
        list.add(stu5);
      Com c=new Com();
      Collections.sort(list,c);
        Iterator<Student> iterator=list.iterator();
        while(iterator.hasNext()){
            Student stu=iterator.next();
            System.out.println( stu.getName()+ stu.getAge()+"岁    分数："+ stu.getScore());
        }

    }
}
